package top.lywivan.search.controller;

import top.lywivan.common.entity.Result;
import top.lywivan.common.pojo.Question;
import top.lywivan.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private SearchService searchService;

    @GetMapping("/wildcard")
    public Result searchWildcardQuestion(@RequestParam String question){
        List<Question> list = searchService.searchWildcardQuestion(question);
        return new Result(true,"模糊查询成功",list);
    }
}
